home *** CD-ROM | disk | FTP | other *** search
/ Amiga Packmags / NewsFlash - Issue 07 (1990-01)(UGA - 17-Bit Software)(Disk 1 of 2)[a].zip / NewsFlash - Issue 07 (1990-01)(UGA - 17-Bit Software)(Disk 1 of 2)[a].adf / doc / Scroll.DOC < prev    next >
Text File  |  1988-01-19  |  5KB  |  152 lines

  1. -------------------------------------------------------------------------
  2.             Softscroller - Created for UGA PD by Brian Postma
  3. -------------------------------------------------------------------------
  4. start:    movem.l        d0-d7/a0-a6,-(a7)
  5.     lea        gfxname,a1    ;Name of graphics library
  6.     move.l        4,a6        ;Execbase
  7.     jsr        -408(a6)    ;Open Library
  8.     move.l        d0,gfxbase    ;Rememer graphics base
  9.     lea        intname,a1    ;Name of intuition lib.
  10.     jsr        -408(a6)    ;Open Library
  11.     move.l        d0,intbase    ;Remember intuition base
  12.     move.l        intbase,a6
  13.     lea        osargs,a0    ;Pointer to newscreen struct.
  14.     jsr        -198(a6)    ;Open Screen
  15.     move.l        d0,screenbase    ;Pointer to screen struct
  16.     beq        quit        ;Could I open it ??
  17.     add.l        #84,d0        ;Screenbase+84
  18.     move.l        d0,rastport    ;Is Rastport
  19.     move.l        gfxbase,a6    
  20.     move.l        rastport,a1
  21.     clr.l        d0        ;Color=0
  22.     jsr        -234(a6)    ;Setrast->Clear Screen
  23.     move.l        screenbase,a0
  24.     move.l        192(a0),d0    ;Pointer to first bitplane
  25.     move.w        d0,planes+6    ;Low word in copperlist
  26.     swap        d0
  27.     move.w        d0,planes+2    ;High word in copperlist
  28.     move.l        gfxbase,a0    ;gfxbase+$32=pointer to clist
  29.     move.l        $32(a0),oldcop    ;save old copperlist
  30.     move.l        #newcop,$32(a0)    ;My own copperlist
  31.     move.l        $6c,oldirq    ;Save old VBL irq pointer
  32.     move.l        #newirq,$6c    ;my VBL interrupt
  33. wait:    btst        #6,$bfe001    ;Left mouse button pressed ??
  34.     bne        wait        ;No !!
  35.     move.l        oldirq,$6c    ;Restore interrupt
  36.     move.l        gfxbase,a0    ;restore
  37.     move.l        oldcop,$32(a1)    ;old copperlist
  38.     move.l        intbase,a6
  39.     move.l        screenbase,a0
  40.     jsr        -66(a6)        ;Close the screen
  41. quit:    movem.l        (a7)+,d0-d7/a0-a6
  42.     rts
  43.  
  44. newirq:    movem.l        d0-d7/a0-a6,-(a7);Save regs
  45.     bsr        scroll
  46.     movem.l        (a7)+,d0-d7/a0-a6;Restore regs
  47.     dc.w        $4ef9        ;Code for 'JUMP'
  48. oldirq:    dc.l        0        ;Jump to oldirq
  49.  
  50. scroll:    move.l        gfxbase,a6
  51.     move.l        #2,d0        ;dx, 2 pixels to the left
  52.     clr.l        d1        ;dy
  53.     move.l        #0,d2        ;min x
  54.     move.l        #0,d3        ;min y
  55.     move.l        #367,d4        ;max x
  56.     move.l        #15,d5        ;max y
  57.     move.l        rastport,a1    ;rastport pointer
  58.     jsr        -396(a6)    ;ScrollRaster
  59.     subq.w        #1,scrcount    ;Counter for newtext
  60.     beq        newtext        ;is zero->new char
  61.     rts                ;else->bye ??
  62. newtext:move.w        #5,scrcount    ;newtext delay set
  63.     move.l        gfxbase,a6
  64.     move.l        rastport,a1
  65.     move.l        #358,d0        ;x
  66.     move.l        #8,d1        ;y
  67.     jsr        -240(a6)    ;move
  68.     move.l        stringpointer,a0;pointer to string
  69.     move.l        #1,d0        ;1 char
  70.     jsr        -60(a6)
  71.     addq.l        #1,stringpointer;Next char
  72.     cmpi.l        #endstring,stringpointer
  73.     bne        notend        ;end of string reached
  74.     move.l        #string,stringpointer;Start al over
  75. notend:    rts
  76.  
  77. newcop:    dc.w    $0092,$0028,$0094,$00d8    ;DFFSTART,DFFSTOP->OverScan
  78.     dc.w    $008e,$296a,$0090,$29fa    ;DIWSTART,DIWSTOP
  79.     dc.w    $0108,$0000,$010a,$0000    ;BPL1MOD,BPL2MOD
  80.     dc.w    $0096,$0020,$0100,$0000    ;Sprites off,planes off
  81.     dc.w    $0180,$0000,$0182,$0fff    ;Colors
  82. planes:    dc.w    $00e0,$0000,$00e2,$0000    ;Plane1 low,high word
  83.     dc.w    $8001,$fffe        ;Wait till line 128 reached
  84.     dc.w    $0100,$1000        ;Bitplane 1 on
  85.     dc.w    $9001,$fffe        ;Wait till line 144 reached
  86.     dc.w    $0100,$0000        ;Bitplanes off
  87.     dc.w    $ffff,$fffe        ;Wait till end
  88.  
  89. osargs:    dc.w    0,0,368,16        ;x-min,y-min,width,height
  90.     dc.w    1            ;depth 1 bitplane
  91.     dc.b    0,1            ;detailpen,blockpen
  92.     dc.w    0,15            ;viewmodes,type=customscreen
  93.     dc.l    textattr,0        ;textattr,title=none
  94.     dc.l    0,0            ;gadgets,bitmap
  95. textattr:
  96.     dc.l    fontname        ;Fontname
  97.     dc.w    9            ;fontsize
  98.     dc.b    0            ;Style=normal
  99.     dc.b    1            ;flags=romfont
  100.  
  101. scrcount:    dc.w    1
  102. oldcop:        dc.l    0
  103. gfxbase:    dc.l    0
  104. intbase:    dc.l    0
  105. rastport:    dc.l    0
  106. screenbase:    dc.l    0
  107. stringpointer:    dc.l    string
  108. intname:    dc.b    "intuition.library",0
  109. gfxname:    dc.b    "graphics.library",0
  110. fontname:    dc.b    "topaz.font",0
  111. string:
  112.  dc.b    "THE UGA PUBLIC DOMAIN SCROLLER - WRITTEN BY BRIAN POSTMA"
  113.  dc.b    "      "
  114. endstring:
  115. -------------------------------------------------------------------------
  116. <How to assemble>
  117.  
  118. This program, a softscroller, was written on seka. To assemble do the
  119. following.
  120. -Load Source file from this disk by typing 'r<CR>' followed by
  121.  'Scroll<CR>'.
  122. -Now assemble by typing 'a<CR><CR>'.
  123. Now you got an assembled object file in memory, you can do the following
  124. -Type 'j<CR>' to make a testrun (remember to reassemble after doing this)
  125. -Type 'wo<CR>' to save an executable file to disk. When you have a
  126.  version 2.0 or higher of 'seka' you will be prompted with 'MODE', here
  127.  type 'c<CR>' to save a chipcode file.
  128.  
  129. <Beware>
  130.  
  131. This program will only run when it is placed in chipmem, because the
  132. copperlist which is used will only work there. When you have a version
  133. 2.0 or higher of 'seka', this is no problem because this program asks
  134. for the type of memory it should use (type 'c'). When you have an older
  135. version, you should turn off your memory expansion.
  136.  
  137. <What's the use>
  138.  
  139. Well, this program demonstrates how you can create a simple softscroller
  140. and shows how you can use your own copperlists, experiment around with
  141. the copperlist, and you will find out how it works (it's the way I learn-
  142. ed it).
  143.  
  144.  
  145. for questions, comments, remarkes contact:
  146.  
  147. Brian Postma
  148. J.v.Hartenstraat 51
  149. 7576VX Oldenzaal (NL)
  150. Tel:05410-14763
  151.  
  152.